package com.aa;

class Link {
	public int i;
	public long l;
	public Link next;

	public Link(int temp, long templ) {
		i = temp;
		l = templ;
		next = null;
	}

	public void displaylink() {
		System.out.print("{" + i + ", " + l + "}");

	}

}

class LinkList {
	private Link first;

	public LinkList() {
		first = null;
	}
	public void insertfirst(int i, long l){
		Link newLink = new Link(i,l);
		newLink.next = first;
		first = newLink;		
	}
	
	public Link deletefirst(){
		Link temp = first;
		first = first.next;
		return temp;
		
	}
	public void displaylist(){
		System.out.print("Last-->first: " +
				" " +
				" ");
		Link current = first;
		while(current != null){
			current.displaylink();
			current = current.next;
		}
		System.out.print("/n");
		
	}
}
